import java.util.Arrays;

public class Example {
    public static void main(String[] args){
        ArrayList<String> list = new ArrayList<>(Arrays.asList("Hello","World"));
        String[] array = (String[]) Arrays.copyOf(list.toArray(), list.size(), String[].class);
        System.out.println(Arrays.toString(array));
    }
}